package com.store.orm.common;

/**
 * 常量类，项目中的所有常量，都放在此类中
 *
 * @author 宫静雨
 * @version 1.0
 */
public final class Constants {

    public static final String WIN_SEP = "\\";
    public static final String LINUX_SEP = "/";

    public static final String OS_NAME = System.getProperty("os.name");

    /* 当前用户路径 */
    public static String USER_PATH;
    public static String RESOURCE_PATH;
    public static String JAVA_PATH;

    /*           可以解析的文件类型                */
    public static final String YAML = ".yml";
    public static final String PROPERTIES = ".properties";
    public static final String JSON = ".json";
    public static final String CLASS = ".class";

    static {
        if (OS_NAME.contains("W")) {
            USER_PATH = System.getProperty("user.dir") + Constants.WIN_SEP;
            RESOURCE_PATH = USER_PATH + "src" + Constants.WIN_SEP + "main" + Constants.WIN_SEP + "resources" + Constants.WIN_SEP;
            JAVA_PATH = USER_PATH + "src" + Constants.WIN_SEP + "main" + Constants.WIN_SEP + "java" + Constants.WIN_SEP;
        } else {
            USER_PATH = System.getProperty("user.dir") + Constants.LINUX_SEP;
            RESOURCE_PATH = USER_PATH + "src" + Constants.LINUX_SEP + "main" + Constants.LINUX_SEP + "resources" + Constants.LINUX_SEP;
            JAVA_PATH = USER_PATH + "src" + Constants.LINUX_SEP + "main" + Constants.LINUX_SEP + "java" + Constants.LINUX_SEP;
        }
    }
}